package com.bensonbasement.snorflux.messages.fromserver;

import java.io.Serializable;

// TODO: Move this class somewhere more appropriate.

public class PlayerInfo implements Serializable {
	private final String playerName;
	private final PlayerStatus status;

	public PlayerInfo(String playerName, PlayerStatus status) {
		super();
		this.playerName = playerName;
		this.status = status;
	}

	public String getPlayerName() {
		return playerName;
	}

	public PlayerStatus getStatus() {
		return status;
	}
	
	@Override
	public String toString() {
		if (status == PlayerStatus.CONNECTED) {
			return playerName;
		}
		else if (status == PlayerStatus.DISCONNECTED) {
			return playerName+" (disconnected)";
		}
		else {
			// Technically we shouldn't see this.
			return playerName+" (quit)";
		}
	}
}
